package com.txts.road.app.device.model.dto;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 设备表单对象
 *
 * @author baoyr
 * @since 2025-07-17 10:48
 */
@Getter
@Setter
@Schema(description = "设备表单对象")
public class DeviceDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "设备ID")
    @NotNull(message = "设备ID不能为空")
    private Long id;

    @Schema(description = "用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @Schema(description = "设备名称")
    @NotBlank(message = "设备名称不能为空")
    @Size(max=100, message="设备名称长度不能超过100个字符")
    private String deviceName;

    @Schema(description = "设备类型")
    @NotBlank(message = "设备类型不能为空")
    @Size(max=50, message="设备类型长度不能超过50个字符")
    private String deviceType;

    @Schema(description = "设备序列号")
    @NotBlank(message = "设备序列号不能为空")
    @Size(max=100, message="设备序列号长度不能超过100个字符")
    private String deviceSn;

    @Schema(description = "固件版本")
    @Size(max=50, message="固件版本长度不能超过50个字符")
    private String firmwareVersion;

    @Schema(description = "设备状态：1-在线，2-离线，3-故障")
    private Integer status;

    @Schema(description = "最后在线时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastOnlineTime;

   


}
